package com.helloniu.wb.managers {

import com.helloniu.wb.containers.BlankPaperWrapper;
import com.helloniu.wb.tools.DrawingTool;
import flash.events.MouseEvent;
import flash.geom.Point;

public class DrawingToolManager {
//    public static function createTool(className:Class, event:MouseEvent):DrawingTool{
//        var newClass:DrawingTool = new className();
//
//        newClass.setStartPoint(new Point(event.localX, event.localY));
//        newClass.setEndPoint(new Point(event.localX, event.localY));
//        newClass.invalidateDisplayList();
//
//        return newClass;
//    }
//
//    /**
//     * createStaticTool is used when you want to add a tool to the
//     * display list without a mouse event
//     * say your surrounding a image to create a halo type effect of some sort
//     * you can just pass an sP,eP (startPoint) and (endPoint) and of course
//     * if you look in the flex doces you find that a point is a holder for x and y pairs
//     **/
//    public static function createStaticTool(className:Class, sP:Point, eP:Point):DrawingTool {
//        var newClass:DrawingTool = new className();
//
//        newClass.setStartPoint(sP);
//        newClass.setEndPoint(eP);
//
//        newClass.invalidateDisplayList();
//
//        return newClass;
//    }
//
//    public static function removeTool(blankPaperWrapper:BlankPaperWrapper, drawingTool:DrawingTool):void{
//        //loop through the array of children tools to remove it from the array
//        for (var i:int = 0; i < blankPaperWrapper.aChildrenTools.length; i++){
//            if(blankPaperWrapper.aChildrenTools.getItemAt(i) == drawingTool){
//                blankPaperWrapper.aChildrenTools.removeItemAt(i);
//            }
//        }
//
//        //trace(blankPaperWrapper.aChildrenTools.length);
//        blankPaperWrapper.removeChild(drawingTool);
//        blankPaperWrapper.selectedItem = null;
//    }
//
//    public static function removeAllTools(blankPaperWrapper:BlankPaperWrapper):void {
//        //loop through the array of children tools to remove it from the array
//        for (var i:int = blankPaperWrapper.aChildrenTools.length - 1; i >= 0; i--){
//            blankPaperWrapper.removeChild(blankPaperWrapper.aChildrenTools.getItemAt(i) as DrawingTool);
//            blankPaperWrapper.aChildrenTools.removeItemAt(i);
//        }
//
//        blankPaperWrapper.selectedItem = null;
//    }
}
}